package com.yihu.cms.service;

import java.io.IOException;

import com.yihu.dataService.hessian.mongodb.interfaceService.ArticleCategoryHService;
import com.yihu.dataService.hessian.resource.ResourceMongoDBManager;


public class ArticleCategoryService{
	ArticleCategoryHService categoryService = null;
	public ArticleCategoryService(){
		try {
			categoryService= (ArticleCategoryHService)ResourceMongoDBManager
					.getSingleton().getBeans("articleCategoryHSC");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public int add(String categoryJson) {
		// TODO Auto-generated method stub
		int result = 0;
		result = categoryService.addCategory(categoryJson);
		return result;
	}

	public int delete(String id) {
		// TODO Auto-generated method stub
		return categoryService.deleteCategory(id);
	}

	public String getArticleCategoryById(String id) {
		String result = categoryService.getCategoryById(id);
		return result;
	}

	public int update(String articleJson) {
		int result = categoryService.updateCategoryByid(articleJson);
		
		return result;
	}

	public String  getArticleCategorys(String cateJson){
		
		return categoryService.getAllCategorys(cateJson);
	}

}
